﻿namespace Services;

public class IocManager
{
    private static object obj = new object();
    private static ILifetimeScope _container { get; set; }

    public static void InitContainer(ILifetimeScope container) 
    {
        if (_container == null)
        {
            lock (obj)
            {
                if (_container == null)
                {
                    _container = container;
                }
            }
        }
    }

    public static T Resolve<T>() 
    {
        return _container.Resolve<T>();
    }
}
